package com.leo.lime.music.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.View;

import java.util.List;

/**
 * Created by android on 18-8-15.
 */

public class ContentViewPagerAdapter extends FragmentPagerAdapter {
    private static final String TAG = "ContentViewPagerAdapter";

    private List<Fragment> mFragments;

    public ContentViewPagerAdapter(FragmentManager fm, List<Fragment> fragments) {
        super(fm);
        mFragments = fragments;
        fm.beginTransaction().commitAllowingStateLoss();
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return super.isViewFromObject(view, object);
    }

    @Override
    public int getCount() {
        return mFragments.size();
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }
}
